﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace BaseInfoManagerDal.Migrations
{
    public partial class red : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "admin_user",
                columns: table => new
                {
                    user_name = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    pass_word = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    user_full_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    user_status = table.Column<int>(type: "int", nullable: false),
                    last_lgoin_date = table.Column<DateTime>(type: "datetime2", nullable: true),
                    last_login_ip = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    creator_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    creator_date = table.Column<DateTime>(type: "datetime2", nullable: false),
                    modifi_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    modifi_date = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_admin_user", x => x.user_name);
                });

            migrationBuilder.CreateTable(
                name: "admin_user_role_relation",
                columns: table => new
                {
                    id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    user_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    role_id = table.Column<int>(type: "int", nullable: false),
                    creator_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    creator_date = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_admin_user_role_relation", x => x.id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "admin_user");

            migrationBuilder.DropTable(
                name: "admin_user_role_relation");
        }
    }
}
